ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) {
	ListNode *L, *p, *r;
	L = new ListNode;
	L->next = NULL;
	r = L;
	bool up = 0;
	int t = 0;
	while (l1 || l2) {
		t = 0;
		if (l1) {
			t += l1->val;
			l1 = l1->next;
		}
		if (l2) {
			t += l2->val;
			l2 = l2->next;
		}
		if (up == true) {
			t++;
			up = false;
		}
		p = new ListNode(t % 10);
		if (t >= 10)
			up = true;
		r->next = p;
		r = r->next;
	}
	if (up)
		r->next = new ListNode(1);
	return L->next;
}